package com.test.kotlin05

class Player6 {
    lateinit var equipment:String//延迟初始化

    fun ready(){
        equipment = "sharp knife"
    }
    fun battle(){
        if(::equipment.isInitialized)//执行前检查是否已经初始化
            println(equipment)
    }
}


fun main() {
    val player = Player6()
//    player.ready()
    player.battle()
}